<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<title><s:property value='%{getText("reader_title")}' /></title>
		<link href="/SCMDB/style/main.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="/SCMDB/js/Super.js"></script>
		<!--script type="text/javascript"
			src="/SCMDB/js/My97DatePicker/WdatePicker.js"></script-->
		<script type="text/javascript"
			src="/SCMDB/js/promptMap.js"></script>
		<s:include value="../commonPage/message.jsp" />
	</head>
	<script>
		function readerAlarm(){
			var startTime = document.getElementById("startTime").value;
			var endTime = document.getElementById("endTime").value;
			if(startTime=="" || endTime==""){
				alert("请输入时间范围！");
				return false;
			}
			window.location="/SCMDB/readerAction!readerList.action?startTime="+startTime+"&endTime="+endTime+"";
		}
		function getMapNameByID(id)
		{
			if(id=="1")
				return "地下监控图";
			else if(id=="2")
				return "地上监控图";
			else if(id=="3")
				return "工程示意图";
			else
				return "未知地图 ";
		}
	</script>
	<body onload="myonload()">
		<h2>
			<s:property value='%{getText("current_position")}' />${parentMenu}>>${currentMenu}
		</h2>
		<div class="main">
			<s:form action="readerAction!findAll.action" method="post"
				theme="simple"><fieldset class="fieldSearch">
					<legend>
						<s:property value='%{getText("reader_legend")}' />
					</legend>
				<table border="0" cellspacing="0" cellpadding="0">
				<tr>
				<td align="right" class="p_8"><s:property value='%{getText("reader_td1")}' /></td><td><s:textfield name="lrmName" id="lrmName" cssClass="sInput"/></td>
				<!--<td align="right" class="p_14"><s:property value='%{getText("reader_td2")}' /></td><td><s:select list="#session.readerType" listKey="key" listValue="value" headerKey="" headerValue="全部"  name="lrmType" /></td>
				--><!--<td align="right" class="p_14"><s:property value='%{getText("reader_td3")}' /></td><td><s:select list="#session.readerStatus" listKey="key" listValue="value" headerKey="" headerValue="全部" name="lrmState" /></td>
				--><td align="right" class="p_14" colspan="2"><s:submit value="查询" cssClass="bSearch" /></td><!--
				<td align="right" class="p_8">开始时间：</td><td><s:textfield name="startTime" id="startTime" readonly="true" cssClass="timeInput" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\\\'startTime\\\')}'})"/></td>
				<td align="right" class="p_8">结束时间：</td><td><s:textfield name="endTime" id="endTime" readonly="true" cssClass="timeInput" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\\\'endTime\\\')}'})"/></td>
				<td align="right" class="p_14" colspan="2"><input type="button" value="历史" class="bSearch" onclick="readerAlarm();" /></td>
				--></tr>
				</table>
				</fieldset>
				<p class="pEdit">
					<input name="set" type="button" class="bExcel" value="导出EXCEL" onclick="window.location.href='/SCMDB/readerAction!downLoadExcel.action'" />
					<!-- input name="set" type="button" class="bSet" value="设置" onclick="window.location.href='/SCMDB/readerAction!initRead.action'" / -->
					<input name="set" type="button" class="bSet" value="设置" onclick="askUserWhichMapToUse()" />
					
					<%=request.getAttribute("button") %>
				</p>
				<table border="0" cellpadding="1" cellspacing="1" class="tableList">
					<thead>
						<tr>
							<th width="5%">
								<input type="checkbox" name="checkbox" value="checkbox"
									onclick="Super.checkAll(this.checked)" title="全选/取消" />
							</th>
							<th width="5%" class="number"><s:property value='%{getText("reader_th1")}' /></th>
							<th width="5%"><s:property value='%{getText("reader_th2")}' /></th>
							<th width="16%">名称</th>
							<th width="8%"><s:property value='%{getText("reader_th5")}' /></th>
							<th width="8%"><s:property value='%{getText("reader_th6")}' /></th>
							<th width="11%">每日安全讲评</th>
							<th width="11%">安全培训交底</th>
							<th width="11%">所属地图</th>
							<th width="8%">读头半径</th>
							<!-- <th width="20%">更新时间</th> -->
						</tr>
					</thead>

					<tbody>
						<s:iterator id="pageBean" status="u"
							value="#session.readerBean.list">
							<s:if test="#pageBean.lrmState==1">
							<tr>
								<td><input type="checkbox" name="checkbox" value="${pageBean.id}" /></td>
								<td class="number">${entity.index+u.index}</td>
								<td>${pageBean.lrmID}</td>
								<td><!--
									<a href="/SCMDB/readerAction!readerList.action?lrmID=<s:property value='#pageBean.lrmID'/>" style="color:blue;cursor:pointer;">
										${pageBean.lrmName}
									</a>-->
									${pageBean.lrmName}
								</td>
								<td>${pageBean.lrmX}</td>
								<td>${pageBean.lrmY}</td>
								<td>
									<s:if test="#pageBean.monitorDaySecurity == false">否</s:if>
									<s:if test="#pageBean.monitorDaySecurity == true">是</s:if>
								</td>
								<td>${pageBean.securityTraining.title}</td>
								<td name="tdMapID">${pageBean.mapID}</td>
								<td>${pageBean.lrmRadius}</td>
								<!-- 
								<td>
									<s:property value='#pageBean.lrmTime.toString("yyyy-MM-dd HH:mm:ss")' />
								</td> -->
									
							</tr>
							</s:if>
						</s:iterator>
						<tr>
							<td colspan="11" class="turnPage">
								<jsp:include flush="true" page="../commonPage/page.jsp">
									<jsp:param name="entity" value="entity" />
								</jsp:include>
							</td>
						</tr>
					</tbody>
				</table>

			</s:form>
		</div>
	</body>
</html>
